﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

@model IEnumerable<sipfe.model.dataAccess.SIPDetCompendio>

@{
    Layout = "";
    int i = 0;
    //@(@item.nIndEleGrupo == 1 ? "No" : "Si")
}<br />
<table width="100%" border="1" cellpadding="0" cellspacing="0"  class="tablaDetalle">
    <tr class="tituloDetalleBlue_1" align="center">
        <td style="width:15px;">#</td>                                    
        <td align="left" style="width:300px;">Nombre elemento</td>
        <td align="left" style="width:140px;">Nombre corto</td>
        <td style="width:120px;">Fecha inicio vigencia</td>
        <td style="width:120px;">Fecha fin vigencia</td>
        <td style="width:100px;">Grupo</td>
        <td style="width:100px;">Código elemento</td>
        <td style="width:80px;">Id</td>
        <td>Actualizar</td>                                     
    </tr> 
@foreach (var item in Model)
{
    i++;    
    <tr class="@(i%2 != 0 ? "odd" : "even")" align="center" id="trDet2@(i)">
        <td>@i</td>
        <td id="tdDet2@(i)" align="left" class="letraLink8" onclick="javascript:compendioElementoDet(this,'trDet2@(i)','@(item.nIdeDetalle)');" >@item.vNomDetalle</td>
        <td align="left">
            @if (@item.nIndEleGrupo == 2)
            {
                <span class="letraLink8" onclick="javascript:listaElementosDelGrupo(this,'@item.nIdeDetalle');">@item.vNomCorto</span>
            }
            else
            {
               @item.vNomCorto
            }
        </td>
        <td>@String.Format("{0:dd/MM/yyyy}",item.dtFecIniVig)</td>
        <td>
            @if (@item.dtFecFinVig.ToString().Length <= 0) {               
              <span><span class="letraLink8" onclick="javascript:cerrarVigenciaCompDetalle(this,'@item.nIdeDetalle');">Cerrar Vigencia</span></span>
            }else{
                @String.Format("{0:dd/MM/yyyy}", item.dtFecFinVig);
            }
        </td>
        <td>
            @if (@item.nIndEleGrupo == 2)
            {
                if (@item.dtFecFinVig.ToString().Length <= 0)
                {
                   <span class="letraLink8" onclick="javascript:agregarElementoAlGrupo(this,'@item.nIdeCompendio','@item.nIdeDetalle');">SI- Agregar</span>
                }
                else
                {
                    @:SI
                }
            }
            else
            {
                @:No
            }
        </td>        
        <td>@item.vCodElemento</td>
        <td>@String.Format("{0}", item.nIdeDetalle)</td>
        <td>
            @if (@item.dtFecFinVig.ToString().Length <= 0)
            {
                <span class="letraLink8" onclick="javascript:updateCompendioDetalle(this,'@item.nIdeDetalle');">Actualizar</span>
            }
            else
            {
                @:Editar
            }
        </td>        
    </tr>
}
</table>
